<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib prefix="error" uri="/WEB-INF/tags/ErrorTag.tld"%>

<t:basicTemplate
	pageTitle="SWIMv2 - ${userName} - Approve Ability Request">

	<jsp:attribute name="extrahead">
		<link rel='stylesheet' href='css/see_ability_style.css'
			type='text/css' />
		<script src="WRITE_SCRIPT_NAME_HERE_NOW_WE_DEBUG_IN_PEACE"></script>
	</jsp:attribute>

	<jsp:body>
    	<h1>Approve Ability Request</h1>
    	<p> Wellcome, ${userName}!</p>
    	<t:errorAndMessage message="${message}" />
		<div class="error-style">
				<error:errors error="${param.error}"></error:errors>
		</div>
		
		<form name="form" action="./SeeAbilityProceed" method="POST"> 
		
		<c:if test="${fn:length(requests) > 0}">
			<c:forEach items="${requests}" var="req"> 
				<div id="see_ability">
					<input type="radio" name="radio_${req.key}" value="Approve">
					<label for="radio_${req.key}">Approve ${req.key}</label>
					<br />
			    	<input type="radio" name="radio_${req.key}" value="Disapprove">
			    	<label for="radio_${req.key}">Disapprove ${req.key}</label>
			    	 
			    	<details>
			 			 <summary> ${req.key} - Click here to see description </summary>
			  			<p> ${req.value} </p>
					</details>
				</div> <br /> <br />
			</c:forEach>
			<input type="submit" value="Approve Selected" name="submit" /> 
		</c:if>
		
		<c:if test="${fn:length(requests) == 0}">
			<h2> There are no requests for abilities to approve </h2>
			<br />
			(deal with it)
		</c:if>
		
		</form>
    	
    </jsp:body>
</t:basicTemplate>